<?php

namespace app\yyzf\controller\api;
use think\Db;

use think\Controller;

class index extends Controller
{
    // 查询楼栋
    public function index()
    {
        $select = Db::table('pre_building')->select();
        if(!$select){
            
            return 0;
        }
        $this->success('查询成功',null,$select);
        // return json_encode($select);
    }
    // 查询首页轮播图
    public function config(){
        $select = Db::table('pre_swiper')->select();
        if(!$select){
            
            $this->error('暂无数据',null,0);
        }
        $this->success('查询成功',null,$select);
        // return  json_encode($select);
    }
    // 楼栋详情
    public function building(){
        $id = $this->request->param('id');
        $select = Db::table('pre_room')->where(['building_id'=>$id])->select();
        // return json_encode($select);
        $this->success('查询成功',null,$select);

    }
}
